import $service from '../../../../../service.js';
var id
const app = getApp();
Page({
    data: {
        map:{},
        isshow:1
    },
    onLoad(e) {
        id = e.id
    },
    onShow(){
        this.getInterrogationHistoryinfo();
    },
    getInterrogationHistoryinfo() {
        app.http.getInterrogationHistoryinfo({id: id}).then(res => {
            this.setData({
                map: res.data
            })
        }).catch(err => {
            $service.showToast(err.msg)
        })
    },
   taptab(e){
       this.setData({
           isshow :e.currentTarget.dataset.index
       })
   },
   gotopage(e){
       var num = e.currentTarget.dataset.num;
       var index = e.currentTarget.dataset.index;
       if(num == 0){//评论 
            $service.openPage('../personal_interrogation_comment/personal_interrogation_comment?log_id=' + this.data.map.inquiryMap.log_id +'&doctor_id='+ this.data.map.doctorMap.doctor_id+'&doctor_name='+ this.data.map.doctorMap.doctor_name)
       }else if(num == 1){//处方用药详情
           $service.openPage('../../../index/index_medication_details/index_medication_details?prescription_id=' + this.data.map.prescriptionListResq[index].id)
       }else if(num == 2){//处方详情
           $service.openPage('../../../index/index_prescription_details/index_prescription_details?prescription_id=' + this.data.map.prescriptionListResq[index].id)
       }
   },
})
